<?php
/**
 * Created by PhpStorm.
 * User: hhl91
 * Date: 2019/4/2
 * Time: 22:22
 * email:hhl913169083@outlook.com
 * detial:php函数篇
 */
    namespace Vendor\Mode1;
    use FooInterface;
    use BarClass as Bar;
    use OtherVendor\OtherPackage\BazClass;

    function fun_time($str1,$str2,$str3){
        fun_body;
    }
    function example($num){
        echo "$num*$num=".$num*$num;
    }
    ///
    function totlal($price,$number){
        $totla=$price*$number;
        return $totla;
    }
    example(10);//调用函数
    $sum=0;
    $phone=totlal(5000,2);
    $computer=totlal(8000,10);
    $sum=$phone+$computer;
    echo "<br>";
    echo "合计".$sum."元";
    class foo
    {
        const VERSION='1.0';
        const DATE_APPROVED="2019-04-02";
        public function samplefunction($a,$b=null){
            if (a==$b){
                bar();
            }elseif ($a>$b){
                $foo->bar($arg1);
            }
        }

    }

?>